package com.ysy.common.entities;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @ClassDescription: 基础实体类
 * @Author:姚斯羽
 * @Create:2025/3/25 14:11
 **/
@Data
@Accessors(chain = true)
public class BaseEntity {

    @Schema(description = "排序")
    @TableField(value = "num")
    private Integer num;


    @Schema(description = "创建时间")
    @TableField(value = "create_time")
    private Date createTime;

    @Schema(description = "基础状态（停用/启用）")
    @TableField(value = "status")
    private String status;

    @TableLogic
    @TableField(value = "deleted")
    @Schema(description = "逻辑删除", hidden = true)
    private Integer deleted = 0;

    @Version
    @TableField(value = "version")
    @Schema(description = "乐观锁", hidden = true)
    private Integer version;
}
